import axios from '@/libs/api.request.js'

export const getSchoolList = () =>{
    return axios.request({
        method:'get',
        data:null,
        url:'school/getSchoolList'
    });
};

export const saveSchoolOrSubSchoolOrDepartment = data => {
    return axios.request({
        method:'post',
        data:data,
        url:'school/saveSchoolOrSubSchoolOrDepartment'
    });
};

export const updateSchoolOrSubSchoolOrDepartment = data => {
    return axios.request({
        method:'post',
        data:data,
        url:'school/updateSchoolOrSubSchoolOrDepartment'
    });
};

export const saveOrUpdateBySchoolOrSubSchoolOrDepartment = data => {
    return data.id ? updateSchoolOrSubSchoolOrDepartment(data) : saveSchoolOrSubSchoolOrDepartment(data);
};

export const removeSchoolOrSubSchoolOrDepartment = data => {
    return axios.request({
        method:'post',
        data:data,
        url:'school/removeSchoolOrSubSchoolOrDepartment'
    });
};

export const searchDepartmentBySchool = () => {
    return axios.request({
        method:'get',
        data:null,
        url:'school/searchDepartmentBySchool'
    });
};

export const searchAllSubSchool = () => {
    return axios.request({
        method:'get',
        data:null,
        url:'subSchool/searchAllSubSchool'
    });
};

export const searchCasVocationalList = () => {
    return axios.request({
        method:'get',
        data:null,
        url:'school/searchCasVocationalList'
    });
};

export const searchCasClassesList = () => {
    return axios.request({
        method:'get',
        data:null,
        url:'school/searchCasClassesList'
    });
};